/**
@Description: Sum 1 to 100(N if you like) without loop,the Solution is to new a class
@author: timlentse(tinglenxan@gmail.com)
@class Name :Solution
@Date:2014-11-06
*/
#include <iostream>
class Solution {
public:
	Solution()
	{
		++N; _Sum += N;
	}


public:
	static unsigned int getSum()
	{
		return(_Sum);
	}


	static unsigned int reset()
	{
		N = 0; _Sum = 0;
	}


private:
	static unsigned int	N;
	static unsigned int	_Sum;
};
unsigned int	Solution::N	= 0;
unsigned int	Solution:: _Sum = 0;
int main()
{
	Solution	*a	= new Solution[100];
	int		sum	= Solution::getSum();
	std::cout << "the sum equals " << sum << std::endl;
	delete[]a;
	a = NULL;
}


